Skip to content

perf: enhance monitor stability with non-blocking LOCK acquisition (#1754)#1773

Closed
zhu6201976 wants to merge 1 commit intounclecode:developfrom
zhu6201976:verify-fix/1754-stability
Closed

perf: enhance monitor stability with non-blocking LOCK acquisition (#1754)#1773
zhu6201976 wants to merge 1 commit intounclecode:developfrom
zhu6201976:verify-fix/1754-stability

Conversation

@zhu6201976
Copy link

Summary:
While the recent changes in develop introduce a global wait_for timeout for update_timeline, the monitor still attempts to "queue" for the global LOCK. Under extreme load, this can lead to unnecessary resource contention.

Improvements:

Non-blocking Stats: Changed LOCK acquisition within monitor.py to a fail-fast mechanism (0.5s timeout). If the crawler pool is busy, the monitor skips the current data point instead of adding to the lock queue.

System Resilience: Ensures that telemetry collection never interferes with the core mission-critical path (browser lifecycle management).

Error Silencing: Downgraded lock-timeout warnings to debug logs to avoid cluttering production logs during expected high-load spikes.

Why this matters:
In high-concurrency enterprise environments, skipping a single monitoring heartbeat is preferable to adding latency to the asyncio event loop.

@ntohidi ntohidi changed the base branch from main to develop February 25, 2026 02:36
@unclecode
Copy link
Owner

Thanks for taking the time to contribute this fix! Your work helped identify and solve this issue - the fix was implemented on the develop branch (via a different approach) and will be in the next release. We've added you to our CONTRIBUTORS file in recognition of your effort. Closing this PR as the fix is already on develop.

@unclecode unclecode closed this Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants